﻿function onSuccess(result) {
    if (result.status === 200) {
        $('#editorModal').modal('hide');
        $('#formctnr').html('');
        var item = $('#specification-groups tr[data-specificationid=' + result.id + ']');
        if (item.length > 0 && result.html != null) {
            // Edit
            item.replaceWith(result.html);
        } else {
            // Create new
            $(result.html).insertAfter('#specification-groups tr[data-id=' + result.refid + ']');
        }
    }
}